/* linkit.js
 * By François Leporcq
 * MIT Licensed.
 */
var Text  = AbstractShape.extend({
    _className: "Text",
    init: function(origin, content){
        this._origin = origin;
        this._content = content;
        this._computedWidth = null;
        this._computedHeight = null;
        this._computedX = null;
        this._computedY = null;
    },
    setContent: function(content){
        this._content = content;
    },
    getContent: function(){
        return this._content;
    },
    setComputedWidth : function(width){
        this._computedWidth = width;
    },
    getComputedWidth : function(){
        return this._computedWidth;
    },
    setComputedHeight : function(height){
        this._computedHeight = height;
    },
    getComputedHeight : function(){
        return this._computedHeight;
    },
    setComputedX : function(x){
        this._computedX = x;
    },
    getComputedX : function(){
        return this._computedX;
    },
    setComputedY : function(y){
        this._computedY = y;
    },
    getComputedY : function(){
        return this._computedY;
    },
    afterWorkspaceAdd: function(workspace){
        var oldStatus = this.isPartOfComposite();
        this.setPartOfComposite(false);
        workspace.draw(this);
        var box = this.element.getBBox();
        workspace.reset(this);
        this.setPartOfComposite(oldStatus);
        this._computedWidth = box.width;
        this._computedHeight = box.height;
        this._computedX = box.x;
        this._computedY = box.y;
    }
});